/*     */ package com.zimbra.cs.ldap;
/*     */ 
/*     */ import com.zimbra.cs.account.AttributeManager;
/*     */ import java.util.Arrays;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public abstract class ZAttributes
/*     */   extends ZLdapElement
/*     */   implements IAttributes
/*     */ {
/*     */   public String getAttrString(String attrName)
/*     */     throws LdapException
/*     */   {
/*  42 */     return getAttrString(attrName, IAttributes.CheckBinary.NOCHECK);
/*     */   }
/*     */   
/*     */   private String getAttrString(String attrName, IAttributes.CheckBinary checkBinary)
/*     */     throws LdapException
/*     */   {
/*     */     String transferAttrName;
/*     */     boolean containsBinaryData;
/*     */     String transferAttrName;
/*  51 */     if (checkBinary == IAttributes.CheckBinary.NOCHECK) {
/*  52 */       boolean containsBinaryData = false;
/*  53 */       transferAttrName = attrName;
/*     */     } else {
/*  55 */       AttributeManager attrMgr = AttributeManager.getInst();
/*  56 */       containsBinaryData = attrMgr == null ? false : attrMgr.containsBinaryData(attrName);
/*  57 */       boolean isBinaryTransfer = attrMgr == null ? false : attrMgr.isBinaryTransfer(attrName);
/*     */       
/*  59 */       transferAttrName = LdapUtil.attrNameToBinaryTransferAttrName(isBinaryTransfer, attrName);
/*     */     }
/*     */     
/*  62 */     return getAttrString(transferAttrName, containsBinaryData);
/*     */   }
/*     */   
/*     */   public String[] getMultiAttrString(String attrName) throws LdapException
/*     */   {
/*  67 */     return getMultiAttrString(attrName, IAttributes.CheckBinary.NOCHECK);
/*     */   }
/*     */   
/*     */   private String[] getMultiAttrString(String attrName, IAttributes.CheckBinary checkBinary)
/*     */     throws LdapException
/*     */   {
/*     */     boolean isBinaryTransfer;
/*     */     boolean containsBinaryData;
/*     */     boolean isBinaryTransfer;
/*  76 */     if (checkBinary == IAttributes.CheckBinary.NOCHECK) {
/*  77 */       boolean containsBinaryData = false;
/*  78 */       isBinaryTransfer = false;
/*     */     } else {
/*  80 */       AttributeManager attrMgr = AttributeManager.getInst();
/*  81 */       containsBinaryData = attrMgr == null ? false : attrMgr.containsBinaryData(attrName);
/*  82 */       isBinaryTransfer = attrMgr == null ? false : attrMgr.isBinaryTransfer(attrName);
/*     */     }
/*     */     
/*  85 */     return getMultiAttrString(attrName, containsBinaryData, isBinaryTransfer);
/*     */   }
/*     */   
/*     */   public String[] getMultiAttrString(String attrName, boolean containsBinaryData, boolean isBinaryTransfer)
/*     */     throws LdapException
/*     */   {
/*  91 */     String transferAttrName = LdapUtil.attrNameToBinaryTransferAttrName(isBinaryTransfer, attrName);
/*  92 */     return getMultiAttrString(transferAttrName, containsBinaryData);
/*     */   }
/*     */   
/*     */   public List<String> getMultiAttrStringAsList(String attrName, IAttributes.CheckBinary checkBinary)
/*     */     throws LdapException
/*     */   {
/*  98 */     if (checkBinary == IAttributes.CheckBinary.NOCHECK) {
/*  99 */       return Arrays.asList(getMultiAttrString(attrName, false));
/*     */     }
/* 101 */     return Arrays.asList(getMultiAttrString(attrName));
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public Map<String, Object> getAttrs()
/*     */     throws LdapException
/*     */   {
/* 114 */     return getAttrs(null);
/*     */   }
/*     */   
/*     */   public abstract Map<String, Object> getAttrs(Set<String> paramSet)
/*     */     throws LdapException;
/*     */   
/*     */   protected abstract String getAttrString(String paramString, boolean paramBoolean)
/*     */     throws LdapException;
/*     */   
/*     */   protected abstract String[] getMultiAttrString(String paramString, boolean paramBoolean)
/*     */     throws LdapException;
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/ldap/ZAttributes.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */